<template>
    <scroll-view style="background-color: #f5f5f5">
        <img
            src="https://ts1.cn.mm.bing.net/th/id/R-C.86ad1b10401d4a6b83f00d17cb04eef6?rik=CppVtnQqOsSaSg&riu=http%3a%2f%2fpic.baike.soso.com%2fugc%2fbaikepic2%2f13936%2f20170509152602-1576941295.jpg%2f0&ehk=4j4SnK61mw9WIQSrKYNiqwoPkdb5zhst3f7E2vQYzSM%3d&risl=&pid=ImgRaw&r=0"
            style="width: 100%; height: 200px"
            mode="aspectFill"
        ></image>
        <div class="card">
            <text class="titleText"> {{ params.type }}</text>
            <TimeSpace></TimeSpace>
        </div>
        <div class="card">
            <text class="titleText"> 空间详情</text>
            <rich-text :nodes="detailHtml"></rich-text>
        </div>
        <div class="bottom" style="width: 100%">
            <div class="card" style="padding-bottom: 20px">
                <div class="row" style="width: 100%">
                    <div
                        style="
                            display: flex;
                            flex-direction: column;
                            align-items: center;
                            flex-grow: 1;
                        "
                        @click="callCs"
                    >
                        <uni-icons type="headphones"></uni-icons>
                        <text class="textCs">联系客服</text>
                    </div>
                    <div
                        style="
                            display: flex;
                            flex-direction: column;
                            align-items: center;
                            flex-grow: 1;
                        "
                        @click="makeReservation"
                    >
                        <uni-icons type="info"></uni-icons>
                        <text class="textCs">预约空间</text>
                    </div>
                </div>
            </div>
        </div>
    </scroll-view>
</template>

<script setup lang="ts">
import { ref, defineProps } from 'vue'

import { onLoad } from '@dcloudio/uni-app'
import TimeSpace from '@/views/activityPages/components/time-place.vue'
import ShareType from '../const/share'
let params = ref({})
const detailHtml = ref('<p>详情ajsldjalsjdlkjalksj大会上利空打击奥克兰决定了卡壳了</p>')
onLoad((e) => {
    console.log(' 空间详情,e=', e)
    params.value = e

    console.log('space detail params', params)
})

function callCs() {
    uni.makePhoneCall({
        phoneNumber: '456465456456'
    })
}
function makeReservation() {
    uni.navigateTo({
        url: `/views/activityPages/office-share/common-share-reservation?type=${params.value.type}`
    })
}
</script>

<style scoped lang="scss">
@import url('@/views/activityPages/style/card.css');
.textCs {
    font-size: 11px;
}
.textBody {
    font-size: 12px;
}
</style>
